package com.cqemme.comm.utils;

import org.springframework.beans.factory.annotation.Value;

/**
 * 
 * ClassName:IdUtils
 * @Description:
 * TODO
 * Company:EM ChongQing SCIENCE And TECHNOLOGY CO.LTD
 * date:2019-06-05
 * @Author:Tommy 测试提交
 *
 * 
 * ******************************************************
 * HISTORY
 * 2019-06-05 add by Tommy
 * 
 *
 */
public class IdUtils {
		@Value("${idwork.workid}")
	 	private static long workid;
		@Value("${idwork.datacenterId}")
	    private static long datacenterId;
	    private static SnowflakeIdWorker snowflakeIdWorker=new SnowflakeIdWorker(workid,datacenterId);
		public static Long getKeyByLong() {
			return snowflakeIdWorker.nextId();
		}
}
